#pragma once
#include "AdderObject.h"

template <class T>
class AdderBuiltinObject :
	public AdderObject
{
public:
	inline AdderBuiltinObject(void) {};
	inline ~AdderBuiltinObject(void) {};

protected:
	inline void BuiltinRegisterFunction(AdderString name, AdderValue*(T::*func)(AdderBytecodeEngine *))
	{
		this->functions.insert(string_function_map(name, new BuiltinClassFunction(this, (BuiltinClassFunction0)(func))));
	}

	inline void BuiltinRegisterFunction(AdderString name, AdderValue*(T::*func)(AdderBytecodeEngine *,
																			AdderValue* arg0))
	{
		this->functions.insert(string_function_map(name, new BuiltinClassFunction(this, (BuiltinClassFunction1)(func))));
	}

	inline void BuiltinRegisterFunction(AdderString name, AdderValue*(T::*func)(AdderBytecodeEngine *,
																			AdderValue* arg0,
																			AdderValue* arg1))
	{
		this->functions.insert(string_function_map(name, new BuiltinClassFunction(this, (BuiltinClassFunction2)(func))));
	}

	inline void BuiltinRegisterFunction(AdderString name, AdderValue*(T::*func)(AdderBytecodeEngine *,
																			AdderValue* arg0,
																			AdderValue* arg1,
																			AdderValue* arg2))
	{
		this->functions.insert(string_function_map(name, new BuiltinClassFunction(this, (BuiltinClassFunction3)(func))));
	}

	inline void BuiltinRegisterFunction(AdderString name, AdderValue*(T::*func)(AdderBytecodeEngine *,
																			AdderValue* arg0,
																			AdderValue* arg1,
																			AdderValue* arg2,
																			AdderValue* arg3))
	{
		this->functions.insert(string_function_map(name, new BuiltinClassFunction(this, (BuiltinClassFunction4)(func))));
	}

	inline void BuiltinRegisterFunction(AdderString name, AdderValue*(T::*func)(AdderBytecodeEngine *,
																			AdderValue* arg0,
																			AdderValue* arg1,
																			AdderValue* arg2,
																			AdderValue* arg3,
																			AdderValue* arg4))
	{
		this->functions.insert(string_function_map(name, new BuiltinClassFunction(this, (BuiltinClassFunction5)(func))));
	}
};